package org.summerframework.core.jackson;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * 根据当前对象以{@link #separator()}分割
 * 如果需要json返回String以{@link #separator()}分割,请配合使用{@link JsonJoinList}
 *
 * @author 石超
 * @version v1.0.0
 */
@Retention(RetentionPolicy.RUNTIME)
@JacksonAnnotationsInside
@JsonSerialize(using = JsonJoinListSerializer.class)
public @interface JoinList {

    /**
     * @return 分隔符
     */
    String separator() default ",";

    /**
     * @return 目标对象
     */
    String target() default "";

    /**
     * @return 目标对象字段名称
     */
    String fieldName() default "";
}
